﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace JobShop
{
    [Description("The numeric representation of the binary chromosome")]
    public class TcPhenotype : TiDuplicable<TcPhenotype>
    {
        private readonly Int32 M;
        private readonly Int32 N;
        public Int32 Row { get; private set; }
        public Int32 Column { get; private set; }
        public Int32[,] Solution { get; set; }
        //------------------------------------------------------------------------------

        public TcPhenotype(Int32 prmMachine, Int32 prmJob)
        {
            M = prmMachine;
            N = prmJob;
            Row = prmMachine;
            Column = prmJob;
            Solution = new Int32[Row, Column];
        }
        //------------------------------------------------------------------------------

        public TcPhenotype Duplicate()
        {
            return Clone() as TcPhenotype;
        }
        //------------------------------------------------------------------------------

        public object Clone()
        {
            TcPhenotype clone = new TcPhenotype(M, N);
            clone.Row = Row;
            clone.Column = Column;
            Array.Copy(Solution, clone.Solution, Solution.Length);
            return clone;
        }
        //------------------------------------------------------------------------------

    }
    //------------------------------------------------------------------------------

}
//------------------------------------------------------------------------------